<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person{
            #n;
            get name(){
                return this.#n;
            }

            set name(perName){
                this.#n = perName;    
            }

            showInfo(){//实例方法
                console.log(`名字:${this.#n}`)
            }

            static showInfo2(){
                console.log("静态方法！");
            }

            constructor(perName){
                this.#n=perName;
            }
        }

        let person1 = new Person('张飞');
        person1.showInfo();
        Person.showInfo2();


        //还有继承
    </script>
</body>
</html>